package com.wwdx.service.impl;

import com.wwdx.model.WwdxBookModel;
import com.wwdx.model.WwdxCopywriterModel;
import com.wwdx.service.WwdxCopywriterServiceI;
import org.springframework.stereotype.Service;

/**
 * @author liguoliang
 * @date 2018/3/30 11:38
 */
@Service
public class WwdxCopywriterServiceImpl extends BaseServiceImpl<WwdxCopywriterModel> implements WwdxCopywriterServiceI{

    @Override
    public WwdxCopywriterModel getCopyWriter(String openId,String merchantId,Long userid, Integer page, Integer rows){
        WwdxCopywriterModel wwdxCopywriterModel = this.getById(userid);
        WwdxBookModel model = WwdxBookModel.builder().status(0).type(0).userid(userid).build();
        wwdxCopywriterModel.setBookList(productService.bookList(wwdxBookService.selectModelList(model,page,rows),openId,merchantId));
        wwdxCopywriterModel.setBookCount(wwdxBookService.selectModelCount(model));
        return wwdxCopywriterModel;
    }
}